//
//  VillageDetailsCell1.m
//  Village
//
//  Created by 程虎 on 2017/9/14.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import "VillageDetailsCell1.h"

@implementation VillageDetailsCell1

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"VillageDetailsCell1";
    VillageDetailsCell1 *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    return cell;
}

- (void)setModel:(Villages *)model
{
    _model = model;
    self.desLab.text = _model.titles;
    self.contentLab.text = _model.contents;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    CGFloat top = 21;
    CGFloat left = 16;
    
    self.desLab.sd_layout
    .leftSpaceToView(self.contentView, left)
    .topSpaceToView(self.contentView, top)
    .widthIs(145)
    .heightIs(21);
    
    self.contentLab.sd_layout
    .leftSpaceToView(self.desLab, 11.5)
    .topEqualToView(self.desLab)
    .rightSpaceToView(self.contentView, left)
    .minHeightIs(21)
    .autoHeightRatio(0);
    
    self.line.sd_layout
    .leftSpaceToView(self.contentView, 15)
    .topSpaceToView(self.contentLab, top)
    .rightSpaceToView(self.contentView, 0)
    .heightIs(0.5);
    
    [self setupAutoHeightWithBottomView:self.line bottomMargin:0];
}
@end
